//
//  ShopViewController.m
//  HuiPinZhiJia
//
//  Created by MS on 16/8/29.
//  Copyright © 2016年 MS. All rights reserved.
//

#import "ShopViewController.h"
#import "SuperNav.h"
@interface ShopViewController ()
@property (nonatomic,strong)UIButton *goShopBtn;
@end

@implementation ShopViewController
- (void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = NO;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"购物车";
    
    [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:0.41 green:0.79 blue:1.00 alpha:1.00]];
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],UITextAttributeFont : [UIFont boldSystemFontOfSize:18]}];
    
       [self nothing];
    // Do any additional setup after loading the view.
}
#pragma mark 购物车为空时
- (void)nothing
{
    UIView *carView = [[UIView alloc]initWithFrame:CGRectMake(0, 66, screenWidth, screenHeight)];
    UILabel *label = [[UILabel alloc]init];
    label.frame = CGRectMake(50, 300, screenWidth - 100, 60);
    label.text = @"购物车什么都没有,赶快去购物吧";
    label.font = [UIFont systemFontOfSize:20];
    
    _goShopBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    _goShopBtn.frame = CGRectMake(50, 370, screenWidth - 100, 60);
    [_goShopBtn setBackgroundColor:[UIColor colorWithRed:0.50 green:0.82 blue:1.00 alpha:1.00]];
    _goShopBtn.tag = 10;
    _goShopBtn.titleLabel.font = [UIFont systemFontOfSize:20];
    [_goShopBtn setTitle:@"去购物" forState:UIControlStateNormal];
    [_goShopBtn addTarget:self action:@selector(shop:) forControlEvents:UIControlEventTouchUpInside];
    [_goShopBtn.layer setCornerRadius:5];
    
    UIImageView *car = [[UIImageView alloc]initWithFrame:CGRectMake(80, 150, screenWidth - 200, 130)];
    car.image = [UIImage imageNamed:@"shopCart.png"];
    [carView addSubview:label];
    [carView addSubview:car];
    [carView addSubview:_goShopBtn];
    car.userInteractionEnabled = YES;
    [self.view addSubview:carView];
   
}
#pragma mark 去购物
- (void)shop:(id)sender
{
    self.tabBarController.selectedIndex = 1;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
